def outer():
    a = 10
    def inner():
        nonlocal a
        a += 1      # if not 'nonlocal' exists :UnboundLocalError: local variable 'a' referenced before assignment
        print(f" inner :a = {a}.")
    return inner

f = outer()
f()
f()
f()
